﻿Imports System.Net.Sockets
Imports MapleLib.PacketLib

Public Class AuthClient
    Private mSocket As Socket
    Private mReceiveBuffer As Byte() = Nothing

    Public Sub New(ByVal pSocket As Socket)
        mSocket = pSocket
        mReceiveBuffer = New Byte(Settings.MAX_RECEIVE_BUFFER - 1) {}
        WaitForData()
    End Sub

    Public Sub WaitForData()
        If Not IsNothing(mSocket) Then
            Dim SI As New SocketInfo(mSocket, 4)
            WaitForData(SI)
        End If
    End Sub

    Public Sub WaitForData(ByVal SI As SocketInfo)
        Try
            mSocket.Shutdown(SocketShutdown.Both)
            mSocket.Close()
        Catch ex As Exception

        End Try
    End Sub
End Class
